<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of ccvRandSeed</title>
  <meta name="keywords" content="ccvRandSeed">
  <meta name="description" content="CCVRANDSEED will set/restore the seed for the defeault random stream">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt;  <a href="index.html">caltech-image-search</a> &gt; ccvRandSeed.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for caltech-image-search&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->

<h1>ccvRandSeed
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>CCVRANDSEED will set/restore the seed for the defeault random stream</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function old = ccvRandSeed(seed, op, type) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> CCVRANDSEED will set/restore the seed for the defeault random stream
 
 INPUTS
 ------
 seed  - the required seed to set, or the old seed
 op    - the required operation
         'set' -&gt; sets the seed and type 
         'restore -&gt; restores the old value from previous call to
           ccvRandSeed, where this value is in 'seed' input
 type  - the type of generator to set as default, look at
         RandStream.create for details
       {'mt19937ar'}

 OUTPUTS
 -------
 old   - the old seed

 See also</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="DEMO.html" class="code" title="function DEMO">DEMO</a>	DEMO a demo script to show typical usage</li><li><a href="ccvAkmeansCreate.html" class="code" title="function [akmeans] = ccvAkmeansCreate(data, k, maxiter, type, ntrees,varrange, meanrange, maxdepth, minvar, cycle, dist, maxbins,sample, mex, matlabout, seed, verbose)">ccvAkmeansCreate</a>	CCVAKMEANS computes kmeans clustering on the input data using</li><li><a href="ccvBowGetDict.html" class="code" title="function [words, nwords] = ccvBowGetDict(data, labels, locs, nwords, type, cluster,tparams, cparams, init, dfile)">ccvBowGetDict</a>	CCVBOWGETDICT computes the dictionary given the input data</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function old = ccvRandSeed(seed, op, type)</a>
0002 <span class="comment">% CCVRANDSEED will set/restore the seed for the defeault random stream</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% INPUTS</span>
0005 <span class="comment">% ------</span>
0006 <span class="comment">% seed  - the required seed to set, or the old seed</span>
0007 <span class="comment">% op    - the required operation</span>
0008 <span class="comment">%         'set' -&gt; sets the seed and type</span>
0009 <span class="comment">%         'restore -&gt; restores the old value from previous call to</span>
0010 <span class="comment">%           ccvRandSeed, where this value is in 'seed' input</span>
0011 <span class="comment">% type  - the type of generator to set as default, look at</span>
0012 <span class="comment">%         RandStream.create for details</span>
0013 <span class="comment">%       {'mt19937ar'}</span>
0014 <span class="comment">%</span>
0015 <span class="comment">% OUTPUTS</span>
0016 <span class="comment">% -------</span>
0017 <span class="comment">% old   - the old seed</span>
0018 <span class="comment">%</span>
0019 <span class="comment">% See also</span>
0020 <span class="comment">%</span>
0021 
0022 <span class="keyword">if</span> ~exist(<span class="string">'type'</span>,<span class="string">'var'</span>) || isempty(type), type = <span class="string">'mt19937ar'</span>; <span class="keyword">end</span>;
0023 
0024 <span class="keyword">switch</span> op
0025   <span class="keyword">case</span> <span class="string">'set'</span>
0026     old = RandStream.setDefaultStream(RandStream.create(type,<span class="string">'Seed'</span>,seed));
0027   <span class="keyword">case</span> <span class="string">'resotre'</span>
0028     RandStream.setDefaultStream(seed);
0029 <span class="keyword">end</span>;</pre></div>
<hr><address>Generated on Fri 05-Nov-2010 19:46:04 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>